package com.snow.useviewdemo.livedata;

import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;

import com.snow.common.base.BaseBasesActivity;
import com.snow.useviewdemo.R;

/**
 * Created by zhaoyt on 1/31/23.
 * Describe:
 */
public class TestViewModelActivity extends BaseBasesActivity {
    private MyViewModel myViewModel;

    @Override
    protected int getContentViewId() {
        return R.layout.activity_test_view_model;
    }

    @Override
    protected void initView() {
        myViewModel = new ViewModelProvider(this).get(MyViewModel.class);
        myViewModel.getLikedNumber().observe(this, new Observer<Integer>() {
            @Override
            public void onChanged(Integer integer) {

            }
        });
    }
}
